home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 52
/
Amiga Format AFCD52 (Issue 136, May 2000).iso
/
+system+
/
afcdinstall
< prev
next >
Wrap
Text File
|
2000-03-01
|
19KB
|
724 lines
; $VER: AFCD_Install 2.3 (29.2.2000)
; by Oliver Roberts (oliver.roberts@iname.com)
;*************
; LOCALE INIT
;*************
(if (= (exists "Env:Language") 1)
(set @language (getenv "Language"))
)
;*****************
; ENGLISH STRINGS
;*****************
(set #str-yes "Yes")
(set #str-no "No")
(set #str-askfind "Copy AFCDFind to your hard drive?")
(set #str-findno "No - I'd rather use it from the CD")
(set #str-findprog "Yes - Just the program itself")
(set #str-findall "Yes - The program and all the indices")
(set #str-finddest "Select where the AFCDFind program files should be installed (no drawer will be created!)")
(set #str-askaminet "Copy the Aminet index listing to your hard drive?\n(requires approx 5Mb disk space)")
(set #str-copyaminetindex "Copying Aminet index file")
(set #str-settooltypes "Setting tooltypes")
(set #str-updating "Updating %s")
(set #str-updateinstaller "Checking to see whether Installer should be updated")
(set #str-updateview "Checking to see whether AFCDView needs to be copied to C: (i.e. if it's not there already or you have an old version")
(set #str-notoncd "Set the NOTONCD tooltype?\n(see help for info)")
(set #str-indexdir "Select where the AFCD index files should be installed")
(set #str-arexxdest "Select where the AFCDFind ARexx script should be installed (required for full functionality)")
(set #str-aminetdest "Select where the Aminet index file should be installed")
(set #str-complete (cat
"Installation of your chosen files has now been completed\n\n"
"The choices that you have made will be saved and will be used "
"as the defaults when you next run this installer"
))
(set #str-installmode (cat
"Do you wish to view/change your existing settings or just update "
"the files using your current settings?"
))
(set #str-modenew "Change these settings")
(set #str-modeview "View settings")
(set #str-modeupdate "Update files")
(set #str-copyafbase "Copying AFBase files")
(set #str-askafbase "Copy AFBase to your hard drive?")
(set #str-afbaseno "No - I'd rather use it from the CD")
(set #str-afbaseyes "Yes")
(set #str-afbasedest "Select where the AFBase should be installed (no drawer will be created!)")
(set #str-askmuibase (cat
"AFBase will require MUIbase to be installed on your drive. Should "
"I run the MUIbase installer for you?"
))
(set #str-muibaseno "No - I'll install it later")
(set #str-muibaseyes "Yes")
(set #str-muibasecancel "I've changed my mind - don't install AFBase!")
(set #str-muibaselaunch "Launching MUIbase installer...")
(set #str-muibasefail (cat
"Unable to launch MUIbase installer - you will need to run the installer "
"manually from +System+/Tools/Workbench/MUIbase)"
))
(set #str-copyunpackers "Copying archive unpackers")
(set #str-askunpackers "Copy LhA, LZX and/or UnZip (archive unpackers) to your hard drive?")
(set #str-unpackersdest "Select directory where the unpackers should be copied to")
(set #str-currentabove "Your current settings are shown above")
(set #str-modeview "View current settings")
(set #str-modecurrent "Change current settings")
(set #str-viewset "Viewing settings via external viewer - close to continue")
(set #str-os35 "Upgrade to AmigaOS 3.5 for optimum functionality!")
(set #str-finddocdest "Select where the AFCDFind help file should be installed")
(set #help-updateinstaller (cat
"This installer script will automatically update your copy of Installer "
"if you are using an older version"
))
(set #help-updateview (cat
"This installer script will automatically update your copy of AFCDView "
"which is required to view files on this CD via the AFCDPrefs system"
))
(set #help-find (cat
"Although AFCDFind works just fine from the CD, you may wish to "
"install it on your hard drive. If so, then there are two different "
"variations to choose from:\n\n"
"1. Just the AFCDFind program files will be copied to your hard "
"drive. You could then create a \"left out\" icon via Workbench "
"so you can easily access AFCDFind from Workbench. However, for "
"this to work, you'll still need an AFCD in your drive.\n\n"
"2. In addition to copying all the AFCDFind program files to your "
"hard drive, you can choose to copy all the CD index files too. "
"This may be faster, and it also means that you can use AFCDFind "
"even if there is no AFCD in your CD drive. However, you'll need "
"to have quite a bit of spare space to use this option (30Mb+ at "
"the time of writing!\n\n"
))
(set #help-notoncd (cat
"Currently, setting this tooltype just changes the text in the Search "
"cycle gadget. Normally, there will be \"This CD\" and \"Last 5 CDs\" options. "
"If you specify this tooltype, these will be replaced with the actual CD "
"numbers. You may prefer this when running AFCDFind off your hard drive "
"instead of the CD.\n\n"
))
(set #help-afbase (cat
"You will be able to use AFBase without problems directly from the CD. "
"However, access to database records could be slow depending on the "
"speed of your CD-ROM drive. Therefore, you may want to consider "
"installing AFBase to your hard drive for extra speed.\n\n"
"Note: AFBase uses Steffen Gutmann's MUIbase software - if you want "
"to install AFBase, MUIbase will need to be present on your hard drive. "
"If this installer can't find it, it'll ask you whether you want to "
"install it or not (MUIbase can be found in +System+/Tools/WB)."
))
;************
; PROCEDURES
;************
(procedure P_SaveChoices
(textfile
(dest "ENV:AFCD_Install")
(append
(cat
("FINDINSTALL=%ld\n" #findinstall)
("FINDDIR=%s\n" #finddir)
("AMINETINSTALL=%ld\n" #aminetinstall)
("AMINETDIR=%s\n" #aminetdir)
("FINDDOPUS=%ld\n" #find-dopus)
("AFBASEINSTALL=%ld\n" #afbaseinstall)
("AFBASEDIR=%s\n" #afbasedir)
("UNPACKINSTALL=%ld\n" #unpackersinstall)
("UNPACKDIR=%s\n" #unpackersdir)
)
)
(safe)
)
(copyfiles
(source "ENV:AFCD_Install")
(dest "ENVARC:")
(nogauge)
(safe)
)
)
(procedure P_ReadFindTooltypes
(set #indexdir (tackon #finddir "AFCD_Indices"))
(set #matchscript (tackon #finddir "AFCDFind-HandleMatch.rexx"))
(set #finddocdir #finddir)
(if (AND (exists (tackon #finddir "AFCDFind.info")) (>= @installer-version 2752524))
(
(set #find-notoncd "off")
(iconinfo
(dest (tackon #finddir "AFCDFind"))
(gettooltype "NOTONCD" "#find-notoncd")
(gettooltype "INDEXDIR" "#indexdir")
(gettooltype "MATCHSCRIPT" "#matchscript")
(gettooltype "HELPFILE" "#helpfile")
(safe)
)
(set #finddocdir (pathonly #helpfile))
)
)
(set #find-notoncd (<> "off" #find-notoncd))
(if (= #indexdir (cat #cddevice ":+System+/Indices"))
(set #indexdir (tackon #finddir "AFCD_Indices"))
)
)
(set #str-sep "------------------------------------------------------------------------------------------\n")
(procedure P_GetViewSettingsString
(cat
("1. Install AFCDFind?\n\n %s\n" (select #findinstall #str-findno #str-findprog #str-findall))
(if (> #findinstall 0) (" Destination: %s\n" #finddir))
(if (> #findinstall 0) (" Help file dir: %s\n" #finddocdir))
(if (> #findinstall 1) (" Index dir: %s\n" #indexdir))
(" NOTONCD tooltype: %s\n" (if #find-notoncd "Set" "Unset"))
(" ARexx script: %s\n" #matchscript)
(#str-sep)
("2. Install AFBase?\n\n %s\n" (if #afbaseinstall #str-yes #str-no))
(if (> #afbaseinstall 0) (" Destination: %s\n" #afbasedir))
(#str-sep)
("3. Install Aminet Index?\n\n %s\n" (if #aminetinstall #str-yes #str-no))
(if (> #aminetinstall 0) (" Destination: %s\n" #aminetdir))
(#str-sep)
("4. Install Unpackers?\n\n %s\n" (if #unpackersinstall #str-yes #str-no))
(if (> #unpackersinstall 0) (" Destination: %s\n" #unpackersdir))
(#str-sep)
)
)
;******
; INIT
;******
(if (= "AFCD" (substr (expandpath ":") 0 4))
; started from an AFCD
(set #cddevice (getdevice ":"))
; not started from an AFCD (for testing purposes)
(set #cddevice "CD0")
)
(set #maxcfglines 15)
(set #finddir @default-dest)
(set #aminetdir @default-dest)
(set #findinstall 0)
(set #aminetinstall 0)
(set #find-notoncd 1)
(set #afbaseinstall 0)
(set #muibaseinstall 0)
(set #afbasedir @default-dest)
(set #unpackersinstall 0)
(set #unpackersdir "C:")
(set #configexists (exists "ENV:AFCD_Install" (noreq)))
(delete "ENV:AFCDCfg.line" (safe))
(set #ln 1)
(if #configexists
(while (> #ln 0)
(run ("C/GetCfgLine ENV:AFCD_Install ENV:AFCDCfg.line %ld" #ln) (safe))
(set #line (getenv "AFCDCfg.line"))
(delete "ENV:AFCDCfg.line" (safe))
(set #linelen (strlen #line))
(if (AND (> (strlen #line) 0) (< #ln #maxcfglines))
(
(set #i 0)
(while (AND (<> (substr #line #i 1) "=") (< #i #linelen))
(set #i (+ #i 1))
)
(if (= (substr #line #i 1) "=")
(
(set #var (substr #line 0 #i))
(set #i (+ #i 1))
(set #k #i)
(while (<> (substr #line #i 1) "\n")
(set #i (+ #i 1))
)
(if (> (- #i #k) 0)
(
(set #val (substr #line #k (- #i #k)))
(if (= "FINDINSTALL" #var)
(set #findinstall (+ #val))
)
(if (= "FINDDIR" #var)
(set #finddir #val)
)
(if (= "AMINETINSTALL" #var)
(set #aminetinstall (+ #val))
)
(if (= "AMINETDIR" #var)
(set #aminetdir #val)
)
(if (= "FINDDOPUS" #var)
(set #find-dopus (+ #val))
)
(if (= "AFBASEINSTALL" #var)
(set #afbaseinstall (+ #val))
)
(if (= "AFBASEDIR" #var)
(set #afbasedir #val)
)
(if (= "UNPACKINSTALL" #var)
(set #unpackersinstall (+ #val))
)
(if (= "UNPACKDIR" #var)
(set #unpackersdir #val)
)
)
)
)
)
(set #ln (+ #ln 1))
)
; else
(set #ln 0)
)
)
)
; ALWAYS ON!
(set #find-dopus 1)
;*******************
; INTERACTIVE START
;*******************
(welcome)
(if #configexists
(if (>= (/ @installer-version 65536) 44)
(
(P_ReadFindTooltypes)
(textfile
(dest "T:Current Install Settings")
(append (P_GetViewSettingsString))
(safe)
)
(showmedia "#settingstxt" "T:Current Install Settings" "upper_center" "small" 1)
(set #interactive
(askchoice
(prompt #str-currentabove)
(help @askchoice-help)
(choices (cat (if (< @installer-version 2752518) "" "\x1b[2p") #str-modenew) #str-modeupdate)
(default 1)
)
)
(closemedia #settingstxt)
(delete "T:Current Install Settings" (safe))
)
; else
(
(P_ReadFindTooltypes)
(textfile
(dest "T:Current Install Settings")
(append (P_GetViewSettingsString))
(safe)
)
(set #choice 0)
(while (= #choice 0)
(set #choice
(askchoice
(prompt #str-os35)
(help @askchoice-help)
(choices (cat (if (< @installer-version 2752518) "" "\x1b[2p") #str-modeview) #str-modecurrent #str-modeupdate)
(default #choice)
)
)
(if (= #choice 0)
(
(working #str-viewset)
(run "C:AFCDView \"T:Current Install Settings\"" (safe))
)
)
)
(set #interactive (- #choice 1))
(delete "T:Current Install Settings" (safe))
)
)
; else
(set #interactive 0)
)
(if (= #interactive 0)
(
(set #findinstall
(askchoice
(prompt #str-askfind)
(help #help-find @askchoice-help)
(choices (cat (if (< @installer-version 2752518) "" "\x1b[2p") #str-findno) #str-findprog #str-findall)
(default #findinstall)
)
)
(if #findinstall
(
(set #finddir
(askdir
(prompt #str-finddest)
(help @askdir-help)
(default #finddir)
)
)
(P_ReadFindTooltypes)
(set #finddocdir
(askdir
(prompt #str-finddocdest)
(help @askdir-help)
(default #finddocdir)
)
)
(if (= #findinstall 2)
(set #indexdir
(askdir
(prompt #str-indexdir)
(help @askdir-help)
(default #indexdir)
(newpath)
)
)
)
(set #matchscript (tackon
(askdir
(prompt #str-arexxdest)
(help @askdir-help)
(default #matchscript)
)
"AFCDFind-HandleMatch.rexx")
)
(set #find-notoncd
(askchoice
(prompt #str-notoncd)
(help #help-notoncd @askchoice-help)
(choices (cat (if (< @installer-version 2752518) "" "\x1b[2p") #str-no) #str-yes)
(default #find-notoncd)
)
)
)
)
(set #afbaseinstall
(askchoice
(prompt #str-askafbase)
(help #help-afbase @askchoice-help)
(choices (cat (if (< @installer-version 2752518) "" "\x1b[2p") #str-afbaseno) #str-afbaseyes)
(default #afbaseinstall)
)
)
(if #afbaseinstall
(set #afbasedir
(askdir
(prompt #str-afbasedest)
(help @askdir-help)
(default #afbasedir)
)
)
)
(set #aminetinstall
(askchoice
(prompt #str-askaminet)
(help @askchoice-help)
(choices (cat (if (< @installer-version 2752518) "" "\x1b[2p") #str-no) #str-yes)
(default #aminetinstall)
)
)
(if #aminetinstall
(set #aminetdir
(askdir
(prompt #str-aminetdest)
(help @askdir-help)
(default #aminetdir)
)
)
)
(set #unpackersinstall
(askchoice
(prompt #str-askunpackers)
(help @askchoice-help)
(choices (cat (if (< @installer-version 2752518) "" "\x1b[2p") #str-no) #str-yes)
(default #unpackersinstall)
)
)
(if #unpackersinstall
(set #unpackersdir
(askdir
(prompt #str-unpackersdest)
(help @askdir-help)
(default #unpackersdir)
)
)
)
)
; else
(
(P_ReadFindTooltypes)
)
)
(if #afbaseinstall
(if (= (getassign "MUIbase") "")
(
(set #muibaseinstall
(askchoice
(prompt #str-askmuibase)
(help #help-afbase @askchoice-help)
(choices (cat (if (< @installer-version 2752518) "" "\x1b[2p") #str-muibaseno) #str-muibaseyes #str-muibasecancel)
(default #muibaseinstall)
)
)
(if (= #muibaseinstall 2)
(
(set #afbaseinstall 0)
(set #muibaseinstall 0)
)
)
)
)
)
;*******************
; COPY FILES ACROSS
;*******************
(onerror (P_SaveChoices))
(complete 0)
(working #str-updateinstaller)
(if (= 0 (run "C:Which Installer NORES >ENV:AFCDInst_tmp" (safe)))
(
(set #installerloc (getenv "AFCDInst_tmp"))
(set #installerloc (substr #installerloc 0 (- (strlen #installerloc) 1)))
)
;else
(set #installerloc "C:")
)
(set #skipinstaller 0)
(set #installerfn (tackon #installerloc "Installer"))
(if (exists #installerfn)
(if (= 0 (run ("C:Version %s >ENV:AFCDInst_tmp" #installerfn) (safe)))
(
(set #verstring (getenv "AFCDInst_tmp"))
(if (= "InstallerNG" (substr #verstring 0 11))
(set #skipinstaller 1)
)
)
)
)
(if (= #skipinstaller 0)
(copylib
(prompt (#str-updating #installerloc))
(help #help-updateinstaller)
(source (cat #cddevice ":+System+/C/Installer"))
(dest (pathonly #installerloc))
(optional nofail)
(confirm)
)
)
(delete "ENV:AFCDInst_tmp" (safe))
(complete 8)
(working #str-updateview)
(copylib
(prompt (#str-updating "C:AFCDView"))
(help #help-updateview)
(source (cat #cddevice ":+System+/C/AFCDView"))
(dest "C:")
(optional nofail)
(confirm)
)
(complete 10)
(if #findinstall
(
(copylib
(source (cat #cddevice ":+System+/Find"))
(dest #finddir)
(newname "AFCDFind")
)
(if (NOT (exists (tackon #finddir "AFCDFind.info")))
(
(copyfiles
(source (cat #cddevice ":+System+/Find.info"))
(dest #finddir)
(newname "AFCDFind.info")
)
(tooltype
(prompt #str-settooltypes)
(dest (tackon #finddir "AFCDFind"))
(noposition)
)
)
)
; clear tooltypes first (bug in installer)
(tooltype
(prompt #str-settooltypes)
(dest (tackon #finddir "AFCDFind"))
(settooltype "NOTONCD")
(settooltype "(NOTONCD)")
(settooltype "FASTSTARTUP")
(settooltype "(FASTSTARTUP)")
(settooltype "HELPFILE")
(settooltype "(HELPFILE")
(settooltype "MATCHSCRIPT")
(settooltype "(MATCHSCRIPT")
(settooltype "INDEXDIR")
(settooltype "(INDEXDIR")
)
; now set tooltypes
(tooltype
(prompt #str-settooltypes)
(dest (tackon #finddir "AFCDFind"))
(if (= 1 #find-notoncd) (settooltype "NOTONCD" "") (settooltype "(NOTONCD)" ""))
(settooltype (if (= 2 #findinstall) "(FASTSTARTUP)" "FASTSTARTUP") "")
(settooltype "HELPFILE" (tackon #finddocdir "AFCDFind.guide"))
(settooltype "MATCHSCRIPT" #matchscript)
(settooltype "INDEXDIR" (if (= #findinstall 2) #indexdir (cat #cddevice ":+System+/Indices")))
)
(if (exists (cat #cddevice ":+System+/Info/AFCDFind.guide"))
(copyfiles
(source (cat #cddevice ":+System+/Info/AFCDFind.guide"))
(dest #finddocdir)
(infos)
)
)
(copyfiles
(source (cat #cddevice ":+System+/AFCDFind-HandleMatch.rexx"))
(dest (pathonly #matchscript))
(infos)
)
)
)
(complete 20)
(if (= #findinstall 2)
(
(if (NOT (exists #indexdir))
(makedir #indexdir (infos))
)
(foreach (cat #cddevice ":+System+/Indices") "(AFCD?|AFCD??)"
(if (< @each-type 0)
(
(set #docopyidx 1)
(set #idxname (cat #cddevice ":+System+/Indices/" @each-name))
(if (exists (tackon #indexdir @each-name))
(if (NOT (earlier (tackon #indexdir @each-name) #idxname))
(set #docopyidx 0)
)
)
(if #docopyidx
(copyfiles
(source #idxname)
(dest #indexdir)
(infos)
)
)
)
)
)
)
)
(complete 70)
(if #afbaseinstall
(
(copyfiles
(prompt #str-copyafbase)
(help @copyfiles-help)
(source (cat #cddevice ":+System+/Info/AFBase"))
(dest #afbasedir)
(infos)
(optional nofail force)
(confirm)
)
(set #datadir (tackon #afbasedir "AFBase_data"))
(if (NOT (exists #datadir))
(makedir #datadir)
)
(copyfiles
(prompt #str-copyafbase)
(help @copyfiles-help)
(source (cat #cddevice ":+System+/Info/AFBase_data"))
(dest #datadir)
(all)
(infos)
(optional nofail force)
(confirm)
)
)
)
(complete 80)
(if #aminetinstall
(copyfiles
(prompt #str-copyaminetindex)
(help @copyfiles-help)
(source (cat #cddevice ":-In_the_Mag-/Reader_Requests/Aminet_Index"))
(dest #aminetdir)
(infos)
(noposition)
(optional nofail askuser)
(confirm)
)
)
(complete 90)
(if #unpackersinstall
(copyfiles
(prompt #str-copyunpackers)
(help @copyfiles-help)
(source (cat #cddevice "C"))
(choices "LhA" "LZX" "UnZip")
(dest #unpackersdir)
(optional nofail askuser)
(confirm)
)
)
(if #muibaseinstall
(
(set #mbdir (tackon #cddevice "+System+/Tools/Workbench/MUIbase"))
(set #error (run ("cd %s\x0arun <>NIL: :+System+/C/Installer \"%s\" APPNAME \"MUIbase V1.2\" DEFUSER AVERAGE LOGFILE t:MUIbase_install.log" #mbdir "Install-MUIbase")
(prompt #str-muibaselaunch)
(help "")
(confirm)
)
)
(if (<> #error 0)
(message #str-muibasefail)
)
)
)
;**************
; SAVE CHOICES
;**************
(complete 99)
(P_SaveChoices)
;*********
; THE END
;*********
(complete 100)
(exit #str-complete (quiet))